import os;

#define sources directory
baijiSource = 'src/'
baijiBuild = 'build/'

#define environment options
os.ccflags = ['-g','-O2','-msse3','-mfpmath=sse','-funroll-all-loops']

os.baijiInclude = ['#src/meshUtils/include', '/usr/include/newmat']
os.mkl = '/opt/intel/mkl/9.1/'


compilo = ARGUMENTS.get('compiler', 'gcc')
if compilo == 'intel':
	os.ccflags = ['-O2','-xP','-ipo', '-msse3','-DYADOS_DOUBLE_PRECISION', '-DMKL_MATRIX','-DLINUX']
	os.cxx = '/opt/intel/cc/9.1.042/bin/icpc'
	os.cc = '/opt/intel/cc/9.1.042/bin/icc'
	os.ar = '/opt/intel/cc/9.1.042/bin/xiar'
	os.ld = '/opt/intel/cc/9.1.042/bin/xild'
else:
	os.cxx = 'g++'
	os.cc = 'gcc'
	os.ar = 'ar'
	os.ld = 'ld'

env = Environment(CCFLAGS = os.ccflags, CC = os.cc, CXX = os.cxx, AR = os.ar, LD = os.ld);


#don't build in src directory, and don't copy source file in build directory
env.VariantDir(baijiBuild, baijiSource, duplicate=0)


env.SConscript('src/meshUtils/SConscript', variant_dir='build/meshUtils/build')
#env.SConscript('matrix/SConscript')
env.SConscript('src/baiji/SConscript', variant_dir='build/baiji/build')
